<template>
  <div class="index">
      <div class="wrap">
        <div class="crumbs flex">
            <router-link to="/" class="p">首页</router-link>
            <router-link class="p" to="/service/enterprise" v-if="parent.meta">>企业大学</router-link>
            <div class="p">>{{title}}</div>
          </div>
        <div class="nav flex-jus">
            <li @click="togNav('/service')">服务商超</li>
            <li @click="togNav('/service/product')">人才服务</li>
            <li class="on" @click="togNav('/service/enterprise')">企业大学</li>
            <li @click="togNav('/service/activity')">活动</li>
          </div>
        <div class="top flex">
          <div class="video"><video ref="video" :src="datas.videoUrl" poster="../../assets/service/product-img1.png" controls="controls"></video></div>
          <!-- <div class="top-img" :style="{background: 'url('+require('../../assets/service/product-img1.png')+') center center no-repeat',backgroundSize:'cover'}"></div> -->
          <div class="top-right">
            <div class="top-right-title">{{datas.title}}</div>
            <div class="p1">{{datas.abstractDesc}}</div>
            <!-- <div class="p1">222人 观看 </div> -->
            <div class="gbtn" @click="play()">立即学习</div>
          </div>
        </div>
        
      </div>
      <div class="centent">
        <div class="wrap">
          <div class="centent-title">描述</div>
          <div class="centent-div" v-html="datas.content"></div>

        </div>
        
      </div>
  </div>
</template>
<script>
import {getInfomationDetail} from '@/api/service/service'
export default {
  name: "index",
  data() {
    return {
        parent:{},                      //获取父路由信息
        title:"",
        img:require("../../assets/image/profile.jpg"),
        id:"",                            //文章id
        datas:{},
        route:{}
    }
  },
  created(){
    this.id=this.getQueryString("id");
    this.getInfomationDetailapi()
  },
  mounted(){
      this.video = this.$refs.video;
      this.route = this.$route;
      this.parent = this.$route.matched[0];
      this.title = this.$route.meta.title;
  },
  methods:{
    togNav(e){
      this.$router.push(e)
    },
    getQueryString (name) { 
      let reg = `(^|&)${name}=([^&]*)(&|$)`
      let r = window.location.search.substr(1).match(reg); 
      if (r != null) return unescape(r[2]); return null; 
    },
    getInfomationDetailapi(){
      getInfomationDetail({id:this.id}).then(res=>{
        this.datas = res.datas
      })
    },
    play() {
      this.video.play();
    },
  }
}
</script>
<style scoped>
video{
  border: 0;
    -webkit-tap-highlight-color: transparent;

    outline:none;

    background: none;

    text-decoration: none;

}
.index{
  background: #fff;
}
.crumbs{
    padding: 10px 0 0 0;
}
.crumbs .p{
    font-size: 14px;
}
.service-title{
  padding: 36px 0 0 0;
  text-align: center;
  color: #5E9F8E;
}
.service-title h2{
  font-size: 36px;
  line-height: 52px;
}
.service-title p{
  font-size: 14px;
  line-height: 24px;
  text-transform:uppercase;
}

.video{
  width: 666px;
  height: 368px;
}
.video video{
  width: 100%;
  height: 100%;
}

.nav {
  padding: 0;
}
.nav li{
  font-size: 16px;
  color: #343434;
  line-height: 20px;
  padding: 0 15px;
  transition:all .5s;
  cursor:pointer;
}
.nav li.on{
  color: #CE3A5C;
}
.nav li:hover{
  color: #CE3A5C;
}
.top {
  padding-top: 90px;
  padding-bottom: 42px;
  background: #fff;
}
.top .top-img{
  width: 438px;
  height: 410px;
}
.top .top-right{
  padding-top: 12px;
  padding-right: 20px;
  padding-left: 35px;
  width: 600px;
  box-sizing:unset
}
.top .top-right .top-right-title{
  height: 24px;
  font-size: 24px;
  line-height: 30px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #111111;
}
.top .top-right .p1{
  font-size: 18px;
  padding: 24px 0 0 0;
  color: #777777;
}
.top .top-right .gbtn{
  width: 162px;
  height: 56px;
  line-height: 56px;
  color: #fff;
  font-size: 20px;
  text-align: center;
  background: #5DA9C1;
  margin-top: 46px;
  cursor:pointer;
}
.top .top-right .p3{
  line-height: 28px;
  font-size: 16px;
  position: relative;
  color: #3EACC4;
  padding-left: 30px;
}
.centent{
  padding:50px 0;
  background: #F7F7F7;
}
.centent .wrap{
  background: #fff;
  box-shadow: 0px 5px 29px 6px rgba(102, 89, 115, 0.06);
  border-radius: 6px;
  padding: 25px 20px;
}
.centent .centent-title{
  font-size: 24px;
  line-height: 30px;
  color: #333333;
  padding-bottom: 20px;
  text-align: left;
}
.content-div{
  line-height: 180%;
}
</style>